<template>
  <div>
    <div>
      <span> {{ countVal }}</span>
    </div>
    <div>
      <button @click="inCreaseVal">inCreaseVal</button>
    </div>
    <div>
      <RemoteView :injectVal="countVal" />
    </div>
  </div>
</template>

<script>
import { defineAsyncComponent } from 'vue';
import RemoteView from './remote.vue';

export default {
  name: 'StepView',
  components: {
    // RemoteView: RemoteView,
    RemoteView: defineAsyncComponent(() => import('./remote.vue')),
  },
  data() {
    return {
      countVal: 2
    }
  },
  beforeCreate() {
    console.clear();
    console.log('StepView beforeCreate');
  },
  created() {
    console.log('StepView created');
  },
  beforeMount() {
    console.log('StepView beforeMount');
  },
  mounted() {
    console.log('StepView mounted');
  },
  beforeUpdate() {
    console.log('StepView beforeUpdate');
  },
  updated() {
    console.log('StepView updated');
  },
  methods: {
    inCreaseVal() {
      this.countVal++;
    }
  }
}
</script>

<style lang="scss" scoped></style>